import axios from "axios";

// create an axios instance
const service = axios.create({
    baseURL: "https://czcxcx-byljfl2.by.gov.cn/store_backend/api",
    timeout: 5000,
});

// request interceptor
service.interceptors.request.use(
    (config) => {
        return config;
    },
    (error) => {
        // do something with request error
        return Promise.reject(error);
    }
);

// response interceptor
service.interceptors.response.use(
    (response) => {
        const res = response.data;
        return res.data

    },
    (error) => {
        console.log("失败error" + error);
        return Promise.reject(error);
    }
);

export default service;